﻿CREATE TABLE [dbo].[RutasPuntoReferencia](
	[id_ruta_refe] [int] IDENTITY(1,1) NOT NULL,
	[id_ruta] [int] NULL,
	[id_punto_referencia] [int] NULL,
 CONSTRAINT [PK_RutasReferencia] PRIMARY KEY CLUSTERED 
(
	[id_ruta_refe] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  ForeignKey [FK_RutasReferencia_PuntosReferencia]    Script Date: 11/12/2012 16:56:59 ******/
ALTER TABLE [dbo].[RutasPuntoReferencia]  WITH CHECK ADD  CONSTRAINT [FK_RutasReferencia_PuntosReferencia] FOREIGN KEY([id_punto_referencia])
REFERENCES [dbo].[PuntosReferencia] ([id_punt_ref])
GO

ALTER TABLE [dbo].[RutasPuntoReferencia] CHECK CONSTRAINT [FK_RutasReferencia_PuntosReferencia]
GO
/****** Object:  ForeignKey [FK_RutasReferencia_Rutas]    Script Date: 11/12/2012 16:56:59 ******/
ALTER TABLE [dbo].[RutasPuntoReferencia]  WITH CHECK ADD  CONSTRAINT [FK_RutasReferencia_Rutas] FOREIGN KEY([id_ruta])
REFERENCES [dbo].[Rutas] ([id_rutas])
GO

ALTER TABLE [dbo].[RutasPuntoReferencia] CHECK CONSTRAINT [FK_RutasReferencia_Rutas]